package com.huobao.yunying.utils;

import java.util.concurrent.ExecutorService;

import com.huobao.yunying.base.HuobaoApplication;
/**
 * function: 线程池工具类
 * name：ThreadPoolUtils
 * date: 2015-5-11
 * time: 上午09:43:01
 * author: xrz
 */
public class ThreadPoolUtils {
	//线程池
	private ExecutorService m_ExecutorService;
	//单例
	private static ThreadPoolUtils m_ThreadPool;
	//构造
	private ThreadPoolUtils() {
		m_ExecutorService = HuobaoApplication.getExecutorService();
	}
	//单例
	public static ThreadPoolUtils newInstant() {
		if (m_ThreadPool == null)
			m_ThreadPool = new ThreadPoolUtils();
		return m_ThreadPool;
	}
	
	/**
	 * function：提交线程任务
	 * ModifyDatetime: 2015-5-11 上午09:42:42
	 * @param runnable
	 */
	public void submit(Runnable runnable) {
		m_ExecutorService.execute(runnable);
	}

}
